<template>
<div :class="['tips-con', type].join(' ')">
  <div class="tips-icon"><a-icon type="exclamation-circle" theme="filled" /></div>
  <div class="tips-title" v-if="isHtml" v-html="tips"></div>
  <div class="tips-title" v-if="!isHtml"><slot></slot></div>

</div>
</template>

<script>
export default {
  name:'Tips',
  props:{
    tips:'',
    isHtml:{type:Boolean,default:()=>true},
    type:{type:String,default:()=>{ return ''}}
  }
}
</script>

<style lang="less">
.tips-con{
  // width: auto;
  // height: 34px;
  display: flex;
  justify-content: flex-start;
  align-items: center;
  background: #F3F6FD;
  border-radius: 2px;
  border: 1px solid #4167E8;
  padding: 0 16px 0 0;
  margin: 10px 0;
  .tips-icon{
    display: flex;
    height: 18px;
    width: 18px;
    border-image-source: radial-gradient(60% 60%, transparent 0px, transparent 100%, cyan 100%);
    border-image-slice: 1;
    border-width: 2px;
    border-style: solid;
    border-image-outset: 1px;
    margin: 0 16px;
    color: #4167e8;
  }
  .tips-title{
    flex: 1;
    display: flex;
    justify-content: flex-start;
    align-items: center;
    font-size: 14px;
    font-family: PingFangSC-Regular, PingFang SC;
    font-weight: 400;
    color: #777777;
    line-height: 22px;
  }
  &.warning{
    background: #fffbe6;
    border: 1px solid #ffe58f;
    .tips-icon{
      color: #faad14;
    }
    .tips-title{
      color: rgba(0,0,0,.85);
    }
  }
  &.error{
    background: #fff1f0;
    border: 1px solid #ffa39e;
    .tips-icon{
      color: #f5222d;
    }
    .tips-title{
      color: rgba(0,0,0,.85);
    }
  }
}
</style>
